package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.CopyrightAuctionUserAgreement;
import com.sc.nft.entity.DigitalCollectionProductInfoAuctionUserAgreement;
import com.sc.nft.mapper.CopyrightAuctionUserAgreementMapper;
import com.sc.nft.mapper.DigitalCollectionProductInfoAuctionUserAgreementMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;


@Slf4j
@Repository
public class CopyrightAuctionUserAgreementDao extends ServiceImpl<CopyrightAuctionUserAgreementMapper, CopyrightAuctionUserAgreement> {

    public int countByUserId(Long userId) {
        LambdaQueryWrapper<CopyrightAuctionUserAgreement> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CopyrightAuctionUserAgreement::getUserId,userId);
        return count(queryWrapper);
    }
}
